public class ComPower {
    double getPower(int elec)
    {
        double price = 0.0;
        if(elec <= 90)
            price = elec * 0.6;
        else if(elec <= 150)
            price = 90 * 0.6 + (elec - 90) * 1.1;
        else if(elec > 150)
            price = 90 * 0.6 + 60 * 1.1 + (elec - 150) * 1.7;

        return price;
    }
}
